#run on R version 3.0.1 (2013-05-16)
library(foreign)
library(xlsx)
library(countrycode)
library(Zelig)
library(apsrtable)
load(file="C:\\Users\\Daniel\\Dropbox\\Journal (II)\\Replication Files\\Hug Replication (Consensus Voting)\\adunvtt.Rda")
#democracy variable is inverted
adunvtt$GASPOLr<-8-adunvtt$GASPOL
#Figure 4: Ritter and Signorinos S vs. proportion of common votes
#pdf("cvasmisf1.pdf")
png("cvasmisf1.png")
par(mfrow=c(1,2))
plot(adunvtt$FRUS,adunvtt$S.x.y,ylim=c(-1,1),xlab="proportion of common votes"
,ylab="S with consensus votes")
plot(adunvtt$FRUS,adunvtt$S.x.x,ylim=c(-1,1),xlab="proportion of common votes"
,ylab="S with consensus votes")
dev.off()
#Figure 5: Cohens ? vs. proportion of common votes
#pdf("cvasmisf2.pdf")
png("cvasmisf2.png")
par(mfrow=c(1,2))
plot(adunvtt$FRUS,adunvtt$K.x.y,ylim=c(-1,1),xlab="proportion of common votes"
,ylab="Kappa with consensus votes")
plot(adunvtt$FRUS,adunvtt$K.x.x,ylim=c(-1,1),xlab="proportion of common votes"
,ylab="Kappa with consensus votes")
dev.off()
#Table 5: Replication of Alesina and Dollar (2000), bilateral aid by US
#(linear regression with White robust standard errors)
zus1.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+FRUSA+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus1b.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+FRUSA+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus2.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+S.x.x+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus3.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+S.x.y+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus4.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+K.x.x+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus5.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+K.x.y+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus.outo<-zus1.out
## this stores Alesina and Dollar's coefficients
for (i in 1: length(zus.outo$result[1]$coefficients)){
zus.outo$result[1]$coefficients[i]<-c(1.84
,1.30 ,0.57,0.06 ,0.39,0.08,40.09 ,5.04,0.01 ,0.01,-0.00,NA,NA,NA,NA,NA)[i]
}
apsrtable(zus.outo,zus1.out,zus2.out,zus4.out,zus3.out,zus5.out,digits=3)
#table A1 total bilateral aid
z.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+FRUSA+FRJPN+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z2.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+S.x.x+S.y.x+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z3.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+S.x.y+S.y.y+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z4.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+K.x.x+K.y.x+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z5.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+K.x.y+K.y.y+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z.outo<-z.out
for (i in 1: length(z.outo$result[1]$coefficients)){
z.outo$result[1]$coefficients[i]<-c(6.563,-0.491,1.568,-0.035,0.383,0.142,-0.006,0.153,
0.291,1.545,6.473,-0.001,0.001,-0.009,NA,NA,NA,NA,NA)[i]
}
apsrtable(z.outo,z.out,z2.out,z4.out,z3.out,z5.out,digits=3)
###table A2 total bilateral aid important resolutions
load( file="e:/info/data/adunvtti.Rda")
adunvtti$GASPOLr<-8-adunvtti$GASPOL
z.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+FRUSA+FRJPN+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtti[adunvtti$X.2>1980,],  model  =  "ls", method= "vcovHC")
z2.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+S.x.x+S.y.x+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtti[adunvtti$dec.x.x>1980,],  model  =  "ls", method= "vcovHC")
z3.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+S.x.y+S.y.y+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtti[adunvtti$X.2>1980,],  model  =  "ls", method= "vcovHC")
z4.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+K.x.x+K.y.x+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtti[adunvtti$dec.x.x>1980,],  model  =  "ls", method= "vcovHC")
z5.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+K.x.y+K.y.y+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtti[adunvtti$dec.x.x>1980,],  model  =  "ls", method= "vcovHC")
z.outo<-z.out
for (i in 1: length(z.outo$result[1]$coefficients)){
z.outo$result[1]$coefficients[i]<-c(6.563,-0.491,1.568,-0.035,0.383,0.142,-0.006,0.153,
0.291,1.545,6.473,-0.001,0.001,-0.009,NA,NA,NA,NA,NA)[i]
}
apsrtable(z.outo,z.out,z2.out,z4.out,z3.out,z5.out,digits=3)
#run on R version 3.0.1 (2013-05-16)
library(foreign)
library(xlsx)
library(countrycode)
library(Zelig)
library(apsrtable)
load(file="C:\\Users\\Daniel\\Dropbox\\Journal (II)\\Replication Files\\Hug Replication (Consensus Voting)\\adunvtt.Rda")
#democracy variable is inverted
adunvtt$GASPOLr<-8-adunvtt$GASPOL
#Table 5: Replication of Alesina and Dollar (2000), bilateral aid by US
#(linear regression with White robust standard errors)
zus1.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+FRUSA+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus1b.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+FRUSA+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus2.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+S.x.x+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus3.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+S.x.y+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus4.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+K.x.x+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus5.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+K.x.y+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus.outo<-zus1.out
## this stores Alesina and Dollar's coefficients
for (i in 1: length(zus.outo$result[1]$coefficients)){
zus.outo$result[1]$coefficients[i]<-c(1.84
,1.30 ,0.57,0.06 ,0.39,0.08,40.09 ,5.04,0.01 ,0.01,-0.00,NA,NA,NA,NA,NA)[i]
}
apsrtable(zus.outo,zus1.out,zus2.out,zus4.out,zus3.out,zus5.out,digits=3)
#table A1 total bilateral aid
z.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+FRUSA+FRJPN+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z2.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+S.x.x+S.y.x+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z3.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+S.x.y+S.y.y+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z4.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+K.x.x+K.y.x+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z5.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+K.x.y+K.y.y+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z.outo<-z.out
for (i in 1: length(z.outo$result[1]$coefficients)){
z.outo$result[1]$coefficients[i]<-c(6.563,-0.491,1.568,-0.035,0.383,0.142,-0.006,0.153,
0.291,1.545,6.473,-0.001,0.001,-0.009,NA,NA,NA,NA,NA)[i]
}
apsrtable(z.outo,z.out,z2.out,z4.out,z3.out,z5.out,digits=3)
###table A2 total bilateral aid important resolutions
load( file="e:/info/data/adunvtti.Rda")
adunvtti$GASPOLr<-8-adunvtti$GASPOL
z.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+FRUSA+FRJPN+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtti[adunvtti$X.2>1980,],  model  =  "ls", method= "vcovHC")
z2.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+S.x.x+S.y.x+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtti[adunvtti$dec.x.x>1980,],  model  =  "ls", method= "vcovHC")
z3.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+S.x.y+S.y.y+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtti[adunvtti$X.2>1980,],  model  =  "ls", method= "vcovHC")
z4.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+K.x.x+K.y.x+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtti[adunvtti$dec.x.x>1980,],  model  =  "ls", method= "vcovHC")
z5.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+K.x.y+K.y.y+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtti[adunvtti$dec.x.x>1980,],  model  =  "ls", method= "vcovHC")
z.outo<-z.out
for (i in 1: length(z.outo$result[1]$coefficients)){
z.outo$result[1]$coefficients[i]<-c(6.563,-0.491,1.568,-0.035,0.383,0.142,-0.006,0.153,
0.291,1.545,6.473,-0.001,0.001,-0.009,NA,NA,NA,NA,NA)[i]
}
apsrtable(z.outo,z.out,z2.out,z4.out,z3.out,z5.out,digits=3)
###Table A3: Replication of Alesina and Dollar (2000), total bilateral aid (other chance-corrected indices I, linear regression with White robust standard errors)
### same for Scott's P and uniform marginals for appendix
z.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+FRUSA+FRJPN+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z2.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+P.x.x+P.y.x+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z3.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+P.x.y+P.y.y+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z4.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+U.x.x+U.y.x+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z5.out  <-  zelig(LNOECD~-1+LNRGDPPC+LNRGDPPC.1+LNPOP+LNPOPSQ+OPEN+
GASPOLr+U.x.y+U.y.y+LNCOLS+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
z.outo<-z.out
for (i in 1: length(z.outo$result[1]$coefficients)){
z.outo$result[1]$coefficients[i]<-c(6.563,-0.491,1.568,-0.035,0.383,0.142,-0.006,0.153,
0.291,1.545,6.473,-0.001,0.001,-0.009,NA,NA,NA,NA,NA)[i]
}
apsrtable(z.outo,z.out,z2.out,z4.out,z3.out,z5.out,digits=3,
coef.names=c("Log GDP per capita","Log GDP per capita^2",
"Log population","Log population^2","Economic openness","Democracy",
"Friend of USA (UNGA voting)","Friend of Japan (UNGA voting)",
"Log years as colony","Egypt","Israel","Percent muslims","Percent catholics",
"Percent other religions (Hindu)","1970-1974","1975-1979","1980-1984","1985-1989",
"1990-1994","P","P","U","U","P","P","U","U")
)
library(texreg)
install.packages("texreg")
library(texreg)
htmlreg(list(zus1.out,zus1b.out,zus2.out,zus3.out,zus4.out,zus5.out),file=("tab2.doc"))
#run on R version 3.0.1 (2013-05-16)
library(foreign)
library(xlsx)
library(countrycode)
library(Zelig)
library(apsrtable)
load(file="C:\\Users\\Daniel\\Dropbox\\Journal (II)\\Replication Files\\Hug Replication (Consensus Voting)\\adunvtt.Rda")
#democracy variable is inverted
adunvtt$GASPOLr<-8-adunvtt$GASPOL
#Table 5: Replication of Alesina and Dollar (2000), bilateral aid by US
#(linear regression with White robust standard errors)
zus1.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+FRUSA+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus1b.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+FRUSA+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus2.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+S.x.x+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus3.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+S.x.y+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus4.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+K.x.x+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus5.out  <-  zelig(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+
GASPOLr+K.x.y+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,  model  =  "ls", method= "vcovHC")
zus.outo<-zus1.out
## this stores Alesina and Dollar's coefficients
for (i in 1: length(zus.outo$result[1]$coefficients)){
zus.outo$result[1]$coefficients[i]<-c(1.84
,1.30 ,0.57,0.06 ,0.39,0.08,40.09 ,5.04,0.01 ,0.01,-0.00,NA,NA,NA,NA,NA)[i]
}
apsrtable(zus.outo,zus1.out,zus2.out,zus4.out,zus3.out,zus5.out,digits=3)
## this stores Alesina and Dollar's coefficients
for (i in 1: length(zus.outo$result[1]$coefficients)){
zus.outo$result[1]$coefficients[i]=c(1.84
,1.30 ,0.57,0.06 ,0.39,0.08,40.09 ,5.04,0.01 ,0.01,-0.00,NA,NA,NA,NA,NA)[i]
}
apsrtable(zus.outo,zus1.out,zus2.out,zus4.out,zus3.out,zus5.out,digits=3)
package.version("zelig")
packageversion("zelig")
packageVersion("zelig")
names(zus.outo)
lm(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+GASPOLr+FRUSA+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90, data=adunvtt,  model  =  "ls", method= "vcovHC")
mod5a <- lm(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+GASPOLr+FRUSA+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90, data=adunvtt,  model  =  "ls", method= "vcovHC")
mod5a <- lm(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+GASPOLr+FRUSA+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90, data=adunvtt, method= "vcovHC")
library(texreg)
htmlreg(list(mod5a),file=("tab2.doc"))
###DAN MODIFIED FOR REPLICATION PURPOSES (BELOW)
mod5_1 <- lm(ODAUSAP1)~-1+LNRGDPPC+OPEN+GASPOLr+FRUSA+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt, method= "vcovHC")
mod5_2 <- lm(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+GASPOLr+FRUSA+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt, method= "vcovHC")
mod5_3 <- lm(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+GASPOLr+S.x.x+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,   method= "vcovHC")
mod5_4 <- lm(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+GASPOLr+S.x.y+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,   method= "vcovHC")
mod5_5 <- lm(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+GASPOLr+K.x.x+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,   method= "vcovHC")
mod5_6 <- lm(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+GASPOLr+K.x.y+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt,   method= "vcovHC")
htmlreg(list(mod5_1,mod5_2,mod5_3,mod5_4,mod5_5,mod5_6),file=("tab5.doc"))
remove(mod5_1)
mod5_1 <- lm(ODAUSAP1)~-1+LNRGDPPC+OPEN+GASPOLr+FRUSA+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90
, data=adunvtt, method= "vcovHC")
htmlreg(list(mod5a,mod5_2,mod5_3,mod5_4,mod5_5,mod5_6),file=("tab5.doc"))
remove(mod5_1)
rename(mod5a, mod5_1)
mod5_1 <- lm(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+GASPOLr+FRUSA+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu, data=adunvtt, method= "vcovHC")
mod5_1b <- lm(log(ODAUSAP1)~-1+LNRGDPPC+OPEN+GASPOLr+FRUSA+COLUSA+COLNUSA+DUMEGY+DUMISR+Musl+Romcath+Hindu+DUM70+DUM75+DUM80+DUM85+DUM90, data=adunvtt, method= "vcovHC")
htmlreg(list(mod5_1,mod5_1b,mod5_2,mod5_3,mod5_4,mod5_5,mod5_6),file=("tab5.doc"))
htmlreg(list(mod5_1b,mod5_2,mod5_3,mod5_4,mod5_5,mod5_6),file=("tab5.doc"))
### Figure 1###
year <- c(1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007)
new.linkages <- c(13,6,4,8,6,5,6,6,5,7,11,6,5,7,11,10,14,7,7,9,11,6,10,7,5,3,1)
countries.total <- c(50,52,53,55,55,53,53,52,51,49,44,44,44,43,42,43,46,44,46,45,46,47,44,38,40,36,33)
par(mar=c(5, 4, 4, 6) + 0.1)
plot(year, new.linkages, pch=16, axes=FALSE, ylim=c(0,15), xlab="", ylab="",
type="b",col="black")
axis(2, ylim=c(0.15),col="black",las=1)  ## las=1 makes horizontal labels
mtext("New PGM Linkages",side=2,line=2.5)
box()
par(new=TRUE)
plot(year, countries.total, pch=15,  xlab="", ylab="", ylim=c(30,60),
axes=FALSE, type="b", col="red")
mtext("Countries with PGM Linkages",side=4,col="red",line=4)
axis(4, ylim=c(30,60), col="red",col.axis="red",las=1)
axis(1,pretty(range(year),5))
mtext("Year",side=1,col="black",line=2.5)
legend("topleft",legend=c("New Linkages","Total Countries"),
text.col=c("black","red"),pch=c(16,15),col=c("black","red"))
### Figure 2 ###
library(ggplot2)
Probs <- data.frame(YearsSinceCoup = c(0, 1 , 2, 3, 4, 5, 6, 7 ,8 , 9 , 10),
PredictedProbabilities = c(.0904854, .0645101,.0572296,.0540501,.0521398,.0508738,.050027,.0493819,.0488847, .0484906, .04817 ),
SE = c( .0227645, .0088194,.0059993 , .0051184, .0051184,.0045618, .0044771,  .0044315,  .0044075,  .0043953,   .0043897),
modelName = "Probability of PGM Linkage Formation")
Probs$YearsSinceCoup <- factor(Probs$YearsSinceCoup,c(0, 1,2,3,4,5,6,7,8,9,10))
interval2 <- -qnorm((1-0.95)/2) # 95% multiplier
limits <- aes(ymax = PredictedProbabilities + SE, ymin=PredictedProbabilities - SE)
ggplot() +
geom_point(data = Probs, aes(x = YearsSinceCoup, y = PredictedProbabilities),
colour = 'red', size = 3) +
geom_pointrange(data = Probs, aes(x = YearsSinceCoup, y = PredictedProbabilities,
ymin = PredictedProbabilities - SE*interval2, ymax = PredictedProbabilities + SE*interval2),
colour = 'red', width = 0.35)+theme_classic(base_size = 18)+ labs(x = "Years Since Coup", y = "Probability of PGM Linkage Formation")
install.packages("ggplot2")
install.packages("ggplot2")
library(ggplot2)
Probs <- data.frame(YearsSinceCoup = c(0, 1 , 2, 3, 4, 5, 6, 7 ,8 , 9 , 10),
PredictedProbabilities = c(.0904854, .0645101,.0572296,.0540501,.0521398,.0508738,.050027,.0493819,.0488847, .0484906, .04817 ),
SE = c( .0227645, .0088194,.0059993 , .0051184, .0051184,.0045618, .0044771,  .0044315,  .0044075,  .0043953,   .0043897),
modelName = "Probability of PGM Linkage Formation")
Probs$YearsSinceCoup <- factor(Probs$YearsSinceCoup,c(0, 1,2,3,4,5,6,7,8,9,10))
interval2 <- -qnorm((1-0.95)/2) # 95% multiplier
limits <- aes(ymax = PredictedProbabilities + SE, ymin=PredictedProbabilities - SE)
ggplot() +
geom_point(data = Probs, aes(x = YearsSinceCoup, y = PredictedProbabilities),
colour = 'red', size = 3) +
geom_pointrange(data = Probs, aes(x = YearsSinceCoup, y = PredictedProbabilities,
ymin = PredictedProbabilities - SE*interval2, ymax = PredictedProbabilities + SE*interval2),
colour = 'red', width = 0.35)+theme_classic(base_size = 18)+ labs(x = "Years Since Coup", y = "Probability of PGM Linkage Formation")
library(ggplot2)
Probs <- data.frame(YearsSinceCoup = c(0, 1 , 2, 3, 4, 5, 6, 7 ,8 , 9 , 10),
PredictedProbabilities = c(.0904854, .0645101,.0572296,.0540501,.0521398,.0508738,.050027,.0493819,.0488847, .0484906, .04817 ),
SE = c( .0227645, .0088194,.0059993 , .0051184, .0051184,.0045618, .0044771,  .0044315,  .0044075,  .0043953,   .0043897),
modelName = "Probability of PGM Linkage Formation")
Probs$YearsSinceCoup <- factor(Probs$YearsSinceCoup,c(0, 1,2,3,4,5,6,7,8,9,10))
interval2 <- -qnorm((1-0.95)/2) # 95% multiplier
limits <- aes(ymax = PredictedProbabilities + SE, ymin=PredictedProbabilities - SE)
ggplot() +
geom_point(data = Probs, aes(x = YearsSinceCoup, y = PredictedProbabilities),
colour = 'red', size = 3) +
geom_pointrange(data = Probs, aes(x = YearsSinceCoup, y = PredictedProbabilities,
ymin = PredictedProbabilities - SE*interval2, ymax = PredictedProbabilities + SE*interval2),
colour = 'red')+theme_classic(base_size = 18)+ labs(x = "Years Since Coup", y = "Probability of PGM Linkage Formation")
